LanguageExt.Core

LanguageExt.Core Prelude Resource using

Contents

class Prelude Source #

Methods

method Try<B> use <A, B> (Try<A> computation, Func<A, B> map) Source #

where A : IDisposable

Use with Try monad in LINQ expressions to auto-clean up disposable items

method Try<B> use <A, B> (Try<A> computation, Func<A, Try<B>> bind) Source #

where A : IDisposable

Use with Try monad in LINQ expressions to auto-clean up disposable items

method Task<B> use <A, B> (Task<A> computation, Func<A, B> map) Source #

where A : IDisposable

Use with Task in LINQ expressions to auto-clean up disposable items

method Task<B> use <A, B> (Task<A> computation, Func<A, Task<B>> bind) Source #

where A : IDisposable

Use with Task in LINQ expressions to auto-clean up disposable items

method Task<B> use <A, B> (Func<A> generator, Func<A, Task<B>> asyncMap) Source #

where A : IDisposable

Functional implementation of the using(...) { } pattern

Parameters

param generator

Generator of disposable to use

param asyncMap

Inner map function that uses the disposable value

returns

Result of await asyncMap(generator())

method Task<B> use <A, B> (A disposable, Func<A, Task<B>> asyncMap) Source #

where A : IDisposable

Functional implementation of the using(...) { } pattern

Parameters

param disposable

Disposable to use

param asyncMap

Inner map function that uses the disposable value

returns

Result of await asyncMap(disposable)

method B use <A, B> (Func<A> generator, Func<A, B> f) Source #

where A : IDisposable

Functional implementation of the using(...) { } pattern

Parameters

param generator

Disposable to use

param f

Inner map function that uses the disposable value

returns

Result of f(generator())

method B use <A, B> (A disposable, Func<A, B> f) Source #

where A : IDisposable

Functional implementation of the using(...) { } pattern

Parameters

param disposable

Disposable to use

param f

Inner map function that uses the disposable value

returns

Result of f(disposable)

method Try<B> tryuse <A, B> (Func<A> disposable, Func<A, B> f) Source #

where A : IDisposable

Functional implementation of the using(...) { } pattern

Parameters

param disposable

Disposable to use

param f

Inner map function that uses the disposable value

returns

Result of f(disposable)

method Try<B> tryuse <A, B> (A disposable, Func<A, B> f) Source #

where A : IDisposable

Functional implementation of the using(...) { } pattern

Parameters

param disposable

Disposable to use

param f

Inner map function that uses the disposable value

returns

Result of f(disposable)